import { defineConfig } from 'vitepress'
import { set_sidebar } from './utils/auto_sidebar.mjs'

// https://vitepress.dev/reference/site-config
export default defineConfig({
  // head: [[ "link", { rel: "icon", href: "../Public/logo.png" } ]],
  title: "陈二星文档站",
  description: "A VitePress Site",
  themeConfig: {
    sidebar: false, // 关闭侧边栏
    aside: "left", // 设置右侧侧边栏在左侧显示
    outlineTitle: "文章目录",
    outline: [2, 6],
    logo: '/logo.png',
    // https://vitepress.dev/reference/default-theme-config
    nav: [
      { text: '嵌入式体系', 
        items: [
          { text: 'C语言', link: './Enabled/CPL' },
          { text: '模电', link: '/A' },
          { text: '数电', link: '/D' },
          { 
            text: 'FreeRTOS',
            items: [
              { text: 'FreeRTOS入门', link: './FreeRTOS/rumen' },
            ],
            // link: '/FreeRTOS' 
          },
        ],
      },
      { text: '嵌入式开发工具', 
        items: [
          { text: 'Git', link: '/git' },
        ]
      },
      {
        text: '两边侧栏', link: '/CLan'
      }
    ],

    // sidebar: {
    //   "/": set_sidebar("/FreeRTOS"),
    //   "/Enabled": set_sidebar("/Enabled"),
    // },

    socialLinks: [
      { icon: 'github', link: 'https://github.com/vuejs/vitepress' }
    ],

    footer: {
      copyright: "Copyright@ 2025 Cerxing.",
    },

    // 设置搜索框的样式
    search: {
      provider: "local",
      options: {
        translations: {
          button: {
            buttonText: "搜索文档",
            buttonAriaLabel: "搜索文档",
          },
          modal: {
            noResultsTest: "无法找到相关结果",
            resetButtonTitle: "清除查询条件",
            footer: {
              selectText: "选择",
              navigateText: "切换",
            },
          },
        },
      },
    },
  },
  
})
